package cn.rxmind.dlicense.core.utils;

import org.springframework.core.env.Environment;

/**
 * 此工具用于读取环境配置
 *
 * @author renxin
 * @email renxinzhiliangzhi@163.com
 * @date 2021/4/15 3:07 下午
 */
public class SpringEnvironmentUtil {

    private static Environment environment;

    public static String getProperty(String key){
        return environment.getProperty(key);
    }

    public synchronized static void setEnvironment(Environment environment) {
        if(SpringEnvironmentUtil.environment != null){return;}
        SpringEnvironmentUtil.environment = environment;
    }
}
